package com.smasher.component;

import android.content.Context;

import androidx.multidex.MultiDexApplication;

import com.smasher.core.log.Logger;
import com.smasher.core.log.ToastUtil;
import com.smasher.core.other.ApplicationContext;
import com.smasher.domain.helper.DomainHelper;
import com.smasher.net.connect.NetConnectManager;
import com.smasher.net.help.Confucius;
import com.smasher.net.http.HttpUtil;
import com.tencent.mmkv.MMKV;

public class ComponentApplication extends MultiDexApplication {


    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        ApplicationContext.setApplicationContext(this);
    }

    @Override
    public void onCreate() {
        super.onCreate();

        ToastUtil.init(this);

        String rootDir = MMKV.initialize(this);

        Logger.init(true, "Component");

        DomainHelper.getInstance().init("http", "crmapi.huaxinzhi.com", -1);
        Confucius.INSTANCE.init("http", "crmapi.huaxinzhi.com", -1);
        HttpUtil.getInstance().initWithCache(this);
        NetConnectManager.INSTANCE.init(this);

    }


}
